import React, { Component } from "react"
import Header from "./c-cnps/Header"
import Main from "./c-cnps/Main"
import Footer from "./c-cnps/Footer"
import axios from "axios"
export class App extends Component {
    constructor() {
        super()
        this.state = {
            headerNameList: [],
        }
    }

    componentDidMount() {
        axios.get("http://123.207.32.32:8000/home/multidata").then((res) => {
            const banners = res.data.data.banner.list
            this.setState({
                headerNameList: banners,
            })
        })
    }
    render() {
        const { headerNameList } = this.state
        return (
            <div className="app">
                <Header headerList={headerNameList} />
                <Header />
                <Main />
                <Footer />
            </div>
        )
    }
}

export default App
